package com.aaa.mrcai.service.impl;

import com.aaa.mrcai.mapper.LogMapper;
import com.aaa.mrcai.pojo.entity.LogData;
import com.aaa.mrcai.pojo.entity.Market;
import com.aaa.mrcai.pojo.vo.LogDataVO;
import com.aaa.mrcai.query.LogQuery;
import com.aaa.mrcai.result.AjaxResult;
import com.aaa.mrcai.service.LogService;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @ Author: Lining
 * @ Date: 2021/12/19 21:07
 */
@Service
public class logServiceImpl implements LogService {

    @Autowired
    private LogMapper logMapper;
    @Override
    public AjaxResult list(LogQuery logQuery) {
        List<LogDataVO> list = logMapper.list(logQuery);
        Long aLong =logMapper.queryLogTotalCount(logQuery);
        Map<String, Object> map = new HashMap<>();
        map.put("currentPageData",list);
        map.put("currentDataTotal",aLong);
        return AjaxResult.success(map);

    }

    @Override
    public AjaxResult getOne(int id) {
        LogDataVO one = logMapper.getOne(id);
        return AjaxResult.success(one);
    }
}
